file(GLOB app_srcs   "./app/*.cc")

# 指定 C++ 标准
#set(CMAKE_CXX_STANDARD 14)
#set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(src_files
    "./main.cc"
    ${app_srcs}
)

set(include_dirs app)

set(requires
            platform
            )

idf_component_register(SRCS ${src_files}
                       INCLUDE_DIRS ${include_dirs}
                       REQUIRES ${requires}
                       WHOLE_ARCHIVE)

# 根据 BOARD_TYPE 配置添加对应的板级文件
if(CONFIG_BOARD_TYPE_BREAD_COMPACT_WIFI)
    set(BOARD_TYPE "bread-compact-wifi")
endif()

# 使用 target_compile_definitions 来定义 BOARD_TYPE
target_compile_definitions(${COMPONENT_LIB}
                    PUBLIC BOARD_TYPE=\"${BOARD_TYPE}\"
                    )
